package system

import (
	"mycms/model/common/request"
)

// 用户登录结构
type Login struct {
	Username string `json:"username" validate:"required" comment:"帐号"`
	Password string `json:"password" validate:"required,min=6,max=16" comment:"密码"`
	Captcha  string `json:"captcha" validate:"required" comment:"验证码"`
	KeyId    string `json:"key_id" validate:"required" comment:"KYE参数"`
}

// 管理员列表--分页条件查询及排序结构体
type SearchAdminParams struct {
	Username string `json:"username" form:"username"`
	Realname string `json:"realname" form:"realname"`
	Status   uint   `json:"status" form:"status"`
	Phone    string `json:"phone" form:"phone"`
	request.PageInfo
}

// 查询管理员详情参数
type AdminInfoParams struct {
	Id uint `json:"id" form:"id" validate:"required,numeric" comment:"ID"`
}

// 编辑管理员参数
type UpdateAdminParams struct {
	Id       uint   `json:"id" form:"id" validate:"required,numeric" comment:"ID"`
	Username string `json:"username" form:"username" validate:"required" comment:"帐号"`
	Password string `json:"password" form:"password" validate:"omitempty,min=6,max=16" comment:"密码"` //	密码非空才做长度验证
	Realname string `json:"realname" form:"realname" validate:"required" comment:"真实姓名"`
	Status   uint   `json:"status" form:"status" validate:"required" comment:"状态"`
	Phone    string `json:"phone" form:"phone" validate:"required" comment:"手机"`
	Email    string `json:"email" form:"email" validate:"email" comment:"邮箱"`
	Remark   string `json:"remark" form:"remark" validate:"" comment:"备注"`
	RoleId   string   `json:"role_id" form:"role_id" comment:"角色ID"`
}

// 新增管理员参数
type CreateAdminParams struct {
	Username string `json:"username" form:"username" validate:"required" comment:"帐号"`
	Password string `json:"password" form:"password" validate:"required,min=6,max=16" comment:"密码"` //	密码非空才做长度验证
	Realname string `json:"realname" form:"realname" validate:"required" comment:"真实姓名"`
	Status   uint   `json:"status" form:"status" validate:"required" comment:"状态"`
	Phone    string `json:"phone" form:"phone" validate:"required" comment:"手机"`
	Email    string `json:"email" form:"email" validate:"omitempty,email" comment:"邮箱"`
	Remark   string `json:"remark" form:"remark" comment:"备注"`
	RoleId   string `json:"role_id" form:"role_id" comment:"角色ID"`
}

// 删除管理员详情参数
type AdminDelParams struct {
	Id uint `json:"id" form:"id" validate:"required,numeric" comment:"ID"`
}
